package com.sysystem.service.impl;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.sysystem.dao.ITrainDao;
import com.sysystem.model.Train;
import com.sysystem.service.ITrainService;

@Service("trainServiceImpl")
public class TrainServiceImpl implements ITrainService {
	
	@Autowired
	private ITrainDao trainDao;

	@Override
	public List<Train> selectAllData(String wechat_cd, String train_kb, int start, int end) {
		Map<String, Object> paramMap = new HashMap<String, Object>();
		paramMap.put("WECHAT_CD", wechat_cd);
		paramMap.put("TRAIN_KB", train_kb);
		paramMap.put("START", start);
		paramMap.put("END", end);
		
		List<Train> rs = trainDao.selectAllData(paramMap);
		return rs;
	}

	@Override
	public int selectAllDataCount(String train_kb) {
		Map<String, Object> paramMap = new HashMap<String, Object>();
		paramMap.put("TRAIN_KB", train_kb);
		int rsCount = trainDao.selectAllDataCount(paramMap);
		return rsCount;
	}

}
